maskbmap:=AllocBitMap(minw,minh,1,IF (rtdrag=FALSE) THEN BMF_INTERLEAVED ELSE 0,NIL)
FOR i:=MAX_CELL-1 TO 0 STEP -1
IF (cell[i].mark=obj)
IF (cell[i].set[current_set]<10)
IF ((cell[i].clip_pix<>0) AND (iconbmap<>0)) THEN BltBitMap(cell[i].clip_pix,0,0,iconbmap,cell[i].xoffset,cell[i].yoffset,cell[i].xsize,cell[i].ysize,$20,$FFFFFFFF,0)
IF ((cell[i].pix<>0) AND (iconbmap<>0)) THEN BltBitMap(cell[i].pix,0,0,iconbmap,cell[i].xoffset,cell[i].yoffset,cell[i].xsize,cell[i].ysize,$E0,$FFFFFFFF,0)
dummy:=cell[i].palet_num
SELECT dummy
CASE 0 ;mask:=%00000000
CASE 1 ;mask:=%00010000
CASE 2 ;mask:=%00100000
CASE 3 ;mask:=%00110000
CASE 4 ;mask:=%01000000
CASE 5 ;mask:=%01010000
CASE 6 ;mask:=%01100000
CASE 7 ;mask:=%01110000
CASE 8 ;mask:=%10000000
CASE 9 ;mask:=%10010000
CASE 10;mask:=%10100000
CASE 11;mask:=%10110000
CASE 12;mask:=%11000000
CASE 13;mask:=%11010000
CASE 14;mask:=%11100000
CASE 15;mask:=%11110000
ENDSELECT
dummy:=retdepth(mode)
SELECT dummy
CASE 4;mask:=(mask AND %00000000)
CASE 5;mask:=(mask AND %00010000)
CASE 6;mask:=(mask AND %00110000)
CASE 7;mask:=(mask AND %01110000)
CASE 8;mask:=(mask AND %11110000)
ENDSELECT
IF ((cell[i].clip_pix<>0) AND (iconbmap<>0)) THEN BltBitMap(cell[i].clip_pix,0,0,iconbmap,cell[i].xoffset,cell[i].yoffset,cell[i].xsize,cell[i].ysize,$E0,mask,0)
Write(newfh,'\n;save file written by - Play KiSS v0.88 for Amiga computers\n\n\n',61)
Close(newfh)
ENDIF
ENDIF
Dispose(filebuf)
ENDIF
ClearPointer(win)
ENDIF
ENDIF
CASE 3
menucolors(buffer)
EasyRequestArgs(win,[20,0,'About "Play KiSS"',
'Play KiSS v0.88 - November 21, 1994\nwritten by Chad Randall\n(crandall@garnet.msen.com)\n---\nKISS/GS4 compatibility:\n256 colors\n256 cells\nUnlimited screen size\n(All limits affected by CHIP memory)\n---\n\nReleased as\nPUBLIC DOMAIN',
'Ok'],0,0)
updatecolors()
ENDSELECT
IF ((dragmode=TRUE) AND (curobj>=0))
IF ((oldx<>drawx) OR (oldy<>drawy))
IF (oldx<>-5000) THEN IF (backrast<>0) THEN ClipBlit(backrast,0,0,rp,oldx-offx,oldy-offy,iconwidth,iconheight,$C0)
IF (backrast<>0) THEN ClipBlit(rp,drawx-offx,drawy-offy,backrast,0,0,iconwidth,iconheight,$C0)
/* IF (cell[i].clip_pix_rp<>0) THEN ClipBlit(cell[i].clip_pix_rp,0,0,rp,cell[i].x[current_set]+cell[i].xoffset,cell[i].y[current_set]+cell[i].yoffset,cell[i].xsize,cell[i].ysize,$20)
IF (cell[i].pix_rp<>0) THEN ClipBlit(cell[i].pix_rp,0,0,rp,cell[i].x[current_set]+cell[i].xoffset,cell[i].y[current_set]+cell[i].yoffset,cell[i].xsize,cell[i].ysize,$E0)
dummy:=cell[i].palet_num
SELECT dummy
CASE 0 ;rp.mask:=%00000000
CASE 1 ;rp.mask:=%00010000
CASE 2 ;rp.mask:=%00100000
CASE 3 ;rp.mask:=%00110000
CASE 4 ;rp.mask:=%01000000
CASE 5 ;rp.mask:=%01010000
CASE 6 ;rp.mask:=%01100000
CASE 7 ;rp.mask:=%01110000
CASE 8 ;rp.mask:=%10000000
CASE 9 ;rp.mask:=%10010000
CASE 10;rp.mask:=%10100000
CASE 11;rp.mask:=%10110000
CASE 12;rp.mask:=%11000000
CASE 13;rp.mask:=%11010000
CASE 14;rp.mask:=%11100000
CASE 15;rp.mask:=%11110000
ENDSELECT
dummy:=retdepth(mode)
SELECT dummy
CASE 4;rp.mask:=(rp.mask AND %00000000)
CASE 5;rp.mask:=(rp.mask AND %00010000)
CASE 6;rp.mask:=(rp.mask AND %00110000)
CASE 7;rp.mask:=(rp.mask AND %01110000)
CASE 8;rp.mask:=(rp.mask AND %11110000)
ENDSELECT
IF (cell[i].clip_pix_rp<>0) THEN ClipBlit(cell[i].clip_pix_rp,0,0,rp,cell[i].x[current_set]+cell[i].xoffset,cell[i].y[current_set]+cell[i].yoffset,cell[i].xsize,cell[i].ysize,$E0)
rp.mask:=%11111111*/
ENDIF
ENDIF
ENDFOR
InstallClipRegion(win.wlayer,oldregion)
END rectangle
IF region
DisposeRegion(region)
ENDIF
ENDPROC
PROC drawobj(obj,xxxx=-500,yyyy=-500)
DEF i,t
DEF minx=10000,miny=10000
DEF region,oldregion=0,rectangle:PTR TO rectangle
DEF xx,yy
region:=NewRegion()
NEW rectangle
rectangle.minx:=10000
rectangle.miny:=10000
FOR i:=0 TO MAX_CELL-1
IF cell[i].mark=obj
xx:=IF (xxxx=-500) THEN cell[i].x[current_set] ELSE xxxx
yy:=IF (yyyy=-500) THEN cell[i].y[current_set] ELSE yyyy
WHILE ((res>0) AND ((Char(buf)<>32) AND (Char(buf)<>10) AND (Char(buf)<>13) AND (Char(buf)<>9) AND (Char(buf)<>":") AND (Char(buf)<>"*") AND (Char(buf)<>",")))